﻿@{
    Layout = "~/Views/Shared/_Dialog.cshtml";
}
@model EC.Entity.Response.Bank.BankResponse
<section class="container-fluid" style="background-color: white;">
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="form">
                    <input type="hidden" id="bankId" name="Id" value="@(Model!=null?Model.Id:0)" />
                    <div class="row m10_t">
                        <div class="col-xs-2 m10_t">
                            <label for="BankName" class="control-label">银行名称</label>
                        </div>
                        <div class="col-xs-4">
                            <input class="form-control" type="text" id="BankName" name="BankName" value="@(Model!=null?Model.BankName:string.Empty)" />
                        </div>
                        <div class="col-xs-2 m10_t">
                            <label for="BankCode" class="control-label">银行编码</label>
                        </div>
                        <div class="col-xs-4">
                            <input class="form-control" type="text" id="BankCode" name="BankCode" value="@(Model!=null?Model.BankCode:string.Empty)" />
                        </div>
                    </div>

                    <div class="row m10_t">
                        <div class="col-xs-2 m10_t">
                            <label for="Remark" class=" control-label">备注</label>
                        </div>
                        <div class="col-xs-4">
                            <input class="form-control" type="text" id="Remark" name="Remark" value="@(Model!=null?Model.Remark:string.Empty)" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
@section footerScript{

    <script type="text/javascript">

        function save() {
            var cover = FlashPay.UI.Mask({
                obj: $("body"),
                opacity: 0.5
            });
            var data = $("#form").serializeJSON();
            FlashPay.Util.Ajax({
                type: "POST",
                url: "/bank/SaveBank",
                data: data,
                success: function (res) {
                    if (res.success) {
                        cover.Remove();
                        FlashPay.UI.DialogOpener().Tip_success("操作成功！");
                        FlashPay.UI.DialogOpener().doSearch();
                        FlashPay.UI.CloseDialog();
                    } else {
                        cover.Remove();
                        FlashPay.UI.Tip_short_warning("操作失败！" + res.message);
                    }
                },
                error: function (json) {
                    cover.Remove();
                    FlashPay.UI.Tip_warning("操作失败！请查看网络，请重试。");
                }
            });

        }
    </script>
}